<?xml version="1.0"?>
<!DOCTYPE xsl:stylesheet [
  <!ENTITY rdf "http://www.w3.org/1999/02/22-rdf-syntax-ns#">
  <!ENTITY rdfs "http://www.w3.org/2000/01/rdf-schema#">
  <!ENTITY dc "http://purl.org/dc/elements/1.1/">
  <!ENTITY dcterms "http://purl.org/dc/terms/">
  <!ENTITY foaf "http://xmlns.com/foaf/0.1/">
  <!ENTITY a "http://xmlns.heustics.org/schema/myelin/0.1/">
  <!ENTITY m "http://xmlns.heustics.org/ontology/myelin/0.1/">
]>
<xsl:stylesheet version="1.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:a="http://xmlns.heustics.org/schema/myelin/0.1/"
  xmlns:l="http://xmlns.heustics.org/schema/i18n/0.1/"
  xmlns:o="http://xmlns.heustics.org/schema/myelin/0.1/GuestProfile#view"
  exclude-result-prefixes="xsl a l o"
>
  <xsl:variable name="o:l10n" select="a:get-l10n('&a;GuestProfile#view')"/>
  
  <xsl:template match="a:keywords" mode="a:main-meta"/>
  
  <xsl:template match="a:dict[@key='guest']">
    <xsl:param name="l10n" select="$o:l10n/l:context[@name='account']/*"/>
    <div class="agent guest">      
      <div class="header">
        <div class="label">
          <span><xsl:value-of select="$l10n[@key='label']"/></span>
          <div class="spacer"/>
        </div>
        <div class="spacer"/>
      </div>
      <div class='dict account'>
        <xsl:apply-templates mode="o:agent-dict">
          <xsl:with-param name="l10n" select="$l10n"/>
        </xsl:apply-templates>
        <div class="spacer"/>
      </div>      
      <div class="spacer"/>
    </div>  
  </xsl:template>
  
  <xsl:template match="a:entry[@key='name']" mode="o:agent-dict" name="o:name-entry">
    <xsl:param name="l10n" select="$o:l10n/l:context[@name='account']/*"/>    
    <div class='entry name'>
      <div class='key'>
        <span><xsl:value-of select="$l10n[@key='name']"/></span>
        <div class="spacer"/>
      </div>
      <div class='value'>
        <span>
          <xsl:value-of select="."/>
        </span>
        <div class="spacer"/>
      </div>
      <div class="spacer"/>
    </div> 
  </xsl:template>
  
  <xsl:template match="a:entry[@key='homepage']" mode="o:agent-dict" name="o:homepage-entry">
    <xsl:param name="l10n" select="$o:l10n/l:context[@name='account']/*"/>    
    <div class='entry homepage'>
      <div class='key'>
        <span><xsl:value-of select="$l10n[@key='homepage']"/></span>
        <div class="spacer"/>
      </div>
      <div class='value'>
        <a href='{.}'>
          <xsl:value-of select="substring(.,8)"/>
        </a>
        <div class="spacer"/>
      </div>
      <div class="spacer"/>
    </div> 
  </xsl:template>
  
  <xsl:template match="a:entry[@key='mbox']" mode="o:agent-dict" name="o:mbox-entry">
    <xsl:param name="l10n" select="$o:l10n/l:context[@name='account']/*"/>    
    <div class='entry mbox'>
      <div class='key'>
        <div><xsl:value-of select="$l10n[@key='mbox']"/></div>
        <div class="spacer"/>
      </div>
      <div class='value'>
        <a href='{.}'>
          <xsl:value-of select="substring(.,8)"/>
        </a>
        <div class="spacer"/>
      </div>
      <div class="spacer"/>
    </div> 
  </xsl:template>  
  
  <xsl:template match="a:grouping[@key='contributions']" mode="a:container-header">
    <div class="label">
      <span>
        <xsl:value-of select="$o:l10n/l:gentext[@key='contributions-label']"/>          
      </span>   
      <div class="spacer"/> 
    </div>
    <div class="description">
       <span>
        <xsl:value-of select="$o:l10n/l:gentext[@key='contributions-description']"/>          
      </span>   
      <div class="spacer"/> 
    </div>
  </xsl:template>
  
  <xsl:template match="a:node[@key='all']" mode="a:container-node">    
    <xsl:param name="l10n" select="$a:container-l10n"/>
    <xsl:call-template name="a:container-node">
      <xsl:with-param name="l10n" select="$l10n"/>
    </xsl:call-template>    
    
    <div class="description">
      <span><xsl:value-of select="a:description"/></span>
      <div class="spacer"/>
    </div>
    
  </xsl:template>
  
</xsl:stylesheet>

